package com.sise.controller.wechat;

import com.sise.bean.CodeMsg;
import com.sise.service.IUserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zj
 */
@RestController
@RequestMapping("/sise/wechat/user")
public class WechatUserController {

    @Resource
    private IUserService userService;

    @RequestMapping("/onLogin")
    public CodeMsg<String> onLogin(String code, String nickName, String avatarUrl, Integer gender) {
        return userService.onLogin(code, nickName, avatarUrl, gender);
    }

    @RequestMapping("getOpenId")
    public CodeMsg<String> getOpenId(String code) {
        return userService.getOpenId(code);
    }
}
